<?php 
defined("VALIDASI") or die ('Tidak diperkenankan mengakses file ini secara langsung !');
if($_SESSION[level]=='sales'|| $_SESSION[level]=='manager') {

$sql_tbltransaksi=mysql_query("select * from v_laporan_penjualan where Keterangan like 'jual%' ORDER BY Jumlah DESC 
LIMIT 0 , 10")
or die(mysql_error());
?>
<h3 align="center">Laporan 10 Permintaan Barang Terlaku</h3>

<table align="center" class="table">
<tr>
<th width="20"><b>No.</b></th>
<th width="300"><b>Barang</b></th>
<th>Supplier</th>
<th>Keterangan</th>
<th>Harga</th>
<th colspan="2">Jumlah</th></tr>
<?php
while($baris_tbltransaksi=mysql_fetch_array($sql_tbltransaksi)) {
$no++;
if($n==0){$warna="#ffffff";$n++;} else {$warna="#dedee";$n--;}
?>
<tr  bgcolor="$warna">
<td align="center"><?php echo $no;?>.</td>
<td><?php echo $baris_tbltransaksi[IDBarang]." - ". $baris_tbltransaksi[NamaBrg];?></td>
<td><?php echo $baris_tbltransaksi[NamaSupplier];?></td>
<td align="center"><?php echo $baris_tbltransaksi[Keterangan];?></td>
<td>Rp. <?php echo str_replace(",",".",number_format($baris_tbltransaksi[Harga],0));?></td>
<td align="center"><?php echo abs($baris_tbltransaksi[Jumlah]);?></td>
</tr>
<?php } ?>
</table>
<p align="center"><a href="./file/penjualan_terbaik_print.php?bln=<?php echo $_POST[bln];?>" target="_blank"><img src="./image/printer.gif" align=right width=5% title="Tampilan Cetak"></a></p>
<?php
} else {
echo "Akses di tolak! anda login sebagai $_SESSION[level]";
}
?>